package vip.liux.backend.application.service.messaging;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import vip.liux.contracts.infrastructure.automap.IgnoreCreationAudited;
import vip.liux.contracts.infrastructure.automap.MapMapper;
import vip.liux.contracts.infrastructure.automap.MapStructConfig;
import vip.liux.contracts.infrastructure.messaging.MessageTemplateValueObj;
import vip.liux.contracts.models.notification.MessageTemplate;

import java.util.List;

@Mapper(config = MapStructConfig.class, uses = {MapMapper.class})
public interface AutoMapperProfile {
    AutoMapperProfile INSTANCE = Mappers.getMapper(AutoMapperProfile.class);

    @Mapping(target = "templateCode", ignore = true)
    @IgnoreCreationAudited
    MessageTemplate toEntity(CreateNotificationPolicyDto dto);

    MessageTemplateValueObj toDto(MessageTemplate entity);

    List<MessageTemplateValueObj> toDtoList(List<MessageTemplate> entity);
}
